def binary_search(target, arr):
    low = 0
    high = len(arr) - 1
    while (low < high):
        middle = (low + high) // 2
        if target == arr[middle]:
            return middle
        if target > arr[middle]:
            low = middle + 1
        else:
            high = middle - 1
    return None

target = [1,2,3,4,5,6,7,8,9,11,213,1214,4214]
print(binary_search(5,target))
print(binary_search(213,target))
print(binary_search(588,target))
